import { Component, Input, OnInit } from '@angular/core';
import { CommentDataProvider } from '../../providers/comment-data/comment-data';


@Component({
  selector: 'comment-list',
  templateUrl: 'comment-list.html'
})
export class CommentListComponent implements OnInit {


  @Input() newsObjectId:string;
  comments: any[];

  constructor(
    public commentDataProvider:CommentDataProvider
  ) {
    
  }

  ngOnInit():void{
    this.commentDataProvider.getCommentByNewsId(this.newsObjectId)
      .subscribe(data=>this.comments = data);
  }



}
